const wxHttpHandler = require('../../utils/wxHttpHandler.js');
const api = require('../../APIConfig/apiConfig.js');
const QQMapWX = require('../../utils/qqmap-wx-jssdk.js')
var app = getApp();
var qqMapSDK;


Page({
  data: {
    transMission: null,
    loaction: ''
  },

  onLoad: function (options) {
    let that = this
    this.setData({
      transMission: app.globalData.transMission
    })
    
    qqMapSDK = new QQMapWX({
      key: 'EWDBZ-3BZ36-BDGSG-MMQHU-KW7OK-FDBMA'
    })
    qqMapSDK.reverseGeocoder({
      location: {
        latitude: this.data.transMission.currentLat / 1E6,
        longitude: this.data.transMission.currentLocation / 1E6
      },
      success: function (addressRes) {
        console.log(addressRes.result.address)
        that.setData({
          loation: addressRes.result.address,
        })
        //这里打印出来很多的东西 就有你想要的地址名称
      }
    })
  },

  onShow: function () {},


})